﻿//////////////////////////////////////////////////////////////////////////////////////////////////////
//Name: Bartosz
//FullName: Adamczewski
//Project: InternalClasses
//Component: InternalClasses
//StartDate: 2009-08-17 19:29:04
//EndDate: 2009-08-17 19:29:04
//Description: The implementation of InternalClasses component.
//Rights:  Copyright (c) Bartosz Adamczewski
/////////////////////////////////////////////////////////////////////////////////////////////////////

#region imports.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection.Emit;
using System.Reflection;
using InternalClasses.Dynamic;

#endregion

namespace InternalClasses.Context.Actions
{
    /// <summary>
    /// The Method Injection Action class.
    /// </summary>
    [global::System.AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)]
    public class MethodInjectionAction : Attribute
    {
        private MethodInfo method;
        private object[] parameters;
        private InjectionType injectionType;

        /// <summary>
        /// Initializes a new instance of the <see cref="MethodInjectionAction"/> class.
        /// </summary>
        public MethodInjectionAction()
        { }

        /// <summary>
        /// Initializes a new instance of the <see cref="MethodInjectionAttribute"/> class.
        /// </summary>
        /// <param name="method">The method.</param>
        /// <param name="parameters">The parameters.</param>
        public MethodInjectionAction(MethodInfo method, InjectionType injectionType, object[] parameters)
        {
            this.method = method;
            this.parameters = parameters;
            this.injectionType = injectionType;
        }

        /// <summary>
        /// Gets the method.
        /// </summary>
        /// <value>The method.</value>
        public MethodInfo Method
        {
            get { return method; }
            protected set { method = value; }
        }

        /// <summary>
        /// Gets the parameters.
        /// </summary>
        /// <value>The parameters.</value>
        public object[] Parameters
        {
            get { return parameters; }
            protected set { parameters = value; }
        }

        /// <summary>
        /// Gets the type of the injection.
        /// </summary>
        /// <value>The type of the injection.</value>
        public InjectionType InjectionType
        {
            get { return injectionType; }
            protected set { injectionType = value; }
        }
    }
}
